<style scoped lang='less'>
</style>

<template>
  <Modal
    v-model='vmodal'
    title='Common Modal dialog box title'
    @on-ok='ok'
    @on-cancel='cancel'
    :mask-closable='false'
  >
    <p>{{'Name: ' + formColumn.name}}</p>
    <p>{{'Age: ' + formColumn.age}}</p>
    <p>{{'Address: ' + formColumn.address}}</p>
  </Modal>
</template>

<script>
export default {
  props: {
    formColumn: {
      type: Array
    },
    modal: {
      type: Boolean
    }
  },
  watch: {
    modal (val) {
      if (val) {
        this.vmodal = true
      } else {
        this.vmodal = false
      }
    }
  },
  data () {
    return {
      vmodal: this.modal
    }
  },
  methods: {
    ok () {
      this.$emit('setModal')
      this.vmodal = false
      this.$Message.info('点击了【确认】按钮')
    },
    cancel () {
      this.$emit('setModal')
      this.vmodal = false
      this.$Message.info('点击了【取消】按钮')
    }
  }
}
</script>
